
/* 
 * File:   tasks.h
 * Author: Administrator
 *
 * Created on 2013?8?14?, ??4:08
 */

#ifndef TASKS_H
#define	TASKS_H

#ifdef	__cplusplus
extern "C" {
#endif

#ifdef	__cplusplus
}
#endif

void AB_BA_Go(int thisdelay, int ITI, float waterlen, float delay2);
void AA_BB_Go(int thisdelay, int ITI, float waterlen, float delay2);

void test_water(void);
void test_odorA(void);
void test_odorB(void);
void test_odorC(void);
void test_odorD(void);


void NewBurstStimOut2(int FreqStim, int DuraStim, int totalStimTime);

void ODNMS_Go(int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, float delay_before_reward);

void test_Laser(void);

void localSendOnce(int thisSp, int thisValue);

void test_lick(void);

void test_BNC(void);

extern unsigned char text7[16];
extern unsigned char text8[16];
extern unsigned char text7_2[16];
extern unsigned char text7_3[16];
extern unsigned char text7_4[16];
extern unsigned char text7_5[16];
extern unsigned char text8_2[16];

struct flagStruct {
    unsigned lick : 1;
    unsigned aa : 1;
    unsigned bb : 1;
    unsigned ab : 1;
    unsigned ba : 1;
    unsigned dual : 1;
    unsigned single : 1;
    unsigned aa2 : 1;
    unsigned bb2 : 1;
    unsigned ab2 : 1;
    unsigned ba2 : 1;
    unsigned aca : 1;
    unsigned acb : 1;
    unsigned bca : 1;
    unsigned bcb : 1;
    unsigned ada : 1;
    unsigned adb : 1;
    unsigned bda : 1;
    unsigned bdb : 1;
    unsigned aal : 1;
    unsigned bbl : 1;
    unsigned abl : 1;
    unsigned bal : 1;
    unsigned pun : 1;
    unsigned punable : 1;
};

extern struct flagStruct Flags;

extern unsigned int hit, miss, falseAlarm, correctRejection, od, in, correctRatio, discrimRate_oneback, lr, lm, lw, lc,hit2, miss2 , falseAlarm2, correctRejection2 , correctRatio2 ,
hit3 , miss3 , falseAlarm3 , correctRejection3 , correctRatio3 , hit4 , miss4, falseAlarm4 , correctRejection4 , correctRatio4;

extern unsigned int oneback_r, oneback_w, oneback_m, oneback_c;
extern unsigned int ITI;
extern float legacyOdorLength;
extern unsigned int LW;
extern unsigned int flaga;
extern unsigned int flagb;
extern int currentMiss;
extern int optoend;
extern unsigned int ra, rb, rc, rd, re;
extern unsigned int ma, mb, mc, md, me;
extern unsigned int wa, wb, wc, wd, we;
extern unsigned int ca, cb, cc, cd, ce;
extern unsigned int ITIa, ITIb, ITIc, ITId, ITIe;
extern unsigned int Delay, Delaya, Delayb, Delayc, Delayd, Delaye;
extern unsigned int totalTrials;
extern unsigned int cra, crb, crc, crd, cre;
extern unsigned int Flagsaaa, Flagsaab, Flagsaac, Flagsaad, Flagsaae;
extern unsigned int Flagsbba, Flagsbbb, Flagsbbc, Flagsbbd, Flagsbbe;
extern unsigned int Flagsaba, Flagsabb, Flagsabc, Flagsabd, Flagsabe;
extern unsigned int Flagsbaa, Flagsbab, Flagsbac, Flagsbad, Flagsbae;
extern unsigned int flaga;
extern unsigned int flagb;
#endif	/* TRIALS_H */

